package web.kx;

import java.io.BufferedReader;
import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.Iterator;
import java.util.Properties;
import java.util.Map.Entry;

public class Config {
	private static Properties properties;

	static {
		properties = new Properties();
		try {
			BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream("./GlobalCfg/config.txt"), "gb2312"));
			properties.load(in);
		} catch (UnsupportedEncodingException e1) {
			e1.printStackTrace();
		} catch (FileNotFoundException e1) {
			e1.printStackTrace();
		} catch (IOException e1) {
			e1.printStackTrace();
		} 
		for (Iterator iterator = properties.entrySet().iterator(); iterator.hasNext();) {
			Entry type = (Entry) iterator.next();
			Main.logger.info( (String) type.getKey()+"="+type.getValue());
		}
	}
	public static String getProperty(String s) {
		return (String) properties.get(s);
	}
	public static void main(String[] ss) {
		System.out.println(getProperty("用户"));
		System.out.println(getProperty("菜"));
	}
}
